using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySQL_SysFrameMVC.Message;
using System.Reflection;
using SysFrame.Message;
using SysFrame.BP;
using TaskAPP.Message;

namespace TaskApp.BP
{
    /// <summary>
    /// taskapp_mainlist方法
    /// </summary>
    public class BLLtaskapp_mainlist
    {
        public Itaskapp_mainlist interface_taskapp_mainlist;

        public BLLtaskapp_mainlist()
        {
            object obj = BPBase.GetAchieve("TaskApp.BP", "taskapp_mainlist");
            interface_taskapp_mainlist = (Itaskapp_mainlist)obj;
        }


        /// <summary>
        /// 得到taskapp_mainlist实体
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public List<Mstaskapp_mainlist> Gettaskapp_mainlistMsByQuery(MsQuery msq)
        {
            return interface_taskapp_mainlist.Gettaskapp_mainlistMsByQuery(msq);
        }

        /// <summary>
        /// 通过TASKAPP_MAINLIST_AUTOID得到实体
        /// </summary>
        /// <param name="TASKAPP_MAINLIST_AUTOID">ID</param>
        /// <returns>实体</returns>
        public Mstaskapp_mainlist Gettaskapp_mainlistMsByKey(string TASKAPP_MAINLIST_AUTOID)
        {
            MsQuery msquery = new MsQuery();
            msquery.strquery += " and TASKAPP_MAINLIST_AUTOID='" + TASKAPP_MAINLIST_AUTOID + "' ";
            List<Mstaskapp_mainlist> lstData = Gettaskapp_mainlistMsByQuery(msquery);
            return lstData[0];
        }

        /// <summary>
        ///  保存taskapp_mainlist信息
        /// </summary>
        /// <param name="ms">实体信息</param>
        /// <returns>消息</returns>
        public MsReturned Savetaskapp_mainlist(Mstaskapp_mainlist ms)
        {
            return interface_taskapp_mainlist.Savetaskapp_mainlist(ms);
        }

        /// <summary>
        /// 得到数据类型
        /// </summary>
        /// <param name="msquery">条件</param>
        /// <returns>数据类型</returns>
        public MsReturned Gettaskapp_mainlistByQuery(MsQuery msquery)
        {
            return interface_taskapp_mainlist.Gettaskapp_mainlistByQuery(msquery);
        }

        /// <summary>
        /// 删除taskapp_mainlist
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deletetaskapp_mainlistByQuery(MsQuery msq)
        {
            return interface_taskapp_mainlist.Deletetaskapp_mainlistByQuery(msq);
        }
        /// <summary>
        /// 删除taskapp_mainlist
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deletetaskapp_mainlistByKey(string TASKAPP_MAINLIST_AUTOID)
        {
            MsQuery msquery = new MsQuery();
            
             if (TASKAPP_MAINLIST_AUTOID.IndexOf(",") > 0)
            {
                msquery.strquery += " and TASKAPP_MAINLIST_AUTOID in (" + TASKAPP_MAINLIST_AUTOID + ") ";
            }
            else
            {
                msquery.strquery += " and TASKAPP_MAINLIST_AUTOID='" + TASKAPP_MAINLIST_AUTOID + "' ";
            }
            return interface_taskapp_mainlist.Deletetaskapp_mainlistByQuery(msquery);
        }
    }
}
